import React from 'react';
import { Link, history, useNavigate, useSearchParams, createSearchParams } from 'umi';
import styles from './index.less';
import logoImg from '@/assets/logo.png'

import './index.less'
export default function Page() {
  const navigate = useNavigate();

  return (
    <div className="main">
      <h1 className={styles.title}>Page index</h1>
      <div>
        <Link to="../">首页</Link> ｜
        <Link to="../desc">详情页</Link>
      </div>
      <hr />
      <button onClick={() => {
        navigate(`/desc?${createSearchParams({ a: 'aaa', b: 'bbbbb' })}`)
      }}>go to index has SearchParams!</button>
      <hr />
      <div>
        <button onClick={() => {
          navigate('/desc', {
            state: {
              c: 987
            }
          })
        }}>go to index has State!</button>
      </div>
      <div>
        <img src={logoImg} width={150} />
      </div>
      <div  className={styles.logo}>
            logo 背景
      </div>
    </div>
  );
}
